package com.mark.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import com.mark.entity.User;
import com.mark.service.IUserService;
import com.mark.util.resmessage.JsonResult;

@RestController
@RequestMapping("/user")
public class UserController {
	@Autowired
	private IUserService userServiceImpl;
	
	@RequestMapping(value="/reg",method=RequestMethod.POST)
	public @ResponseBody JsonResult register(@RequestBody User user){
		int result = userServiceImpl.insert(user);
		JsonResult rs = new JsonResult();
		if(result!=0){
			rs.setSuccess(true);
			rs.setErrCode(0);
		}
		return rs;
		
	}
}
